<?php
declare (strict_types = 1);

namespace app\controller;

use app\BaseController;
use app\service\ScoreService;
use think\App;
use think\Request;

class ScoreController extends BaseController
{
    private $service;

    public function __construct(App $app)
    {

        parent::__construct($app);
        $this->service = new ScoreService();
    }
    public function getScore(){
        return $this->service->getScore();
    }
    public function deleteScore($id){
        $this->service->deleteScore($id);
        return $this->returnJson();
    }
    public function updateScore(){
        $id = $this->request->put('id');
        $this->service->updateScore($id);
        return $this->returnJson();
    }
}
